Skip to content

Refactor IssueHandler from supervisor to issue_verification_agent #473

Merged
TomasKorbar merged 1 commit into
packit:mainfrom
martinky82:resolve-conflicts
May 25, 2026
Merged

Refactor IssueHandler from supervisor to issue_verification_agent #473
TomasKorbar merged 1 commit into
packit:mainfrom
martinky82:resolve-conflicts

Conversation

@martinky82

Copy link
Copy Markdown
Contributor

TODO:

  • Write new tests or update the old ones to cover new functionality.
  • Update doc-strings where appropriate.
  • Update or write new documentation in packit/packit.dev.
  • ‹fill in›

Fixes

Related to

Merge before/after

RELEASE NOTES BEGIN

Packit now supports automatic ordering of ☕ after all checks pass.

RELEASE NOTES END

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Issue Verification Agent, migrating the post-fix lifecycle management from the supervisor to a dedicated BeeAI workflow. Key additions include modules for baseline test reproduction, XUnit comparison, and a testing analyst agent, along with several new tools for interacting with Jira, GitLab, the Errata Tool, and Testing Farm. Feedback highlights a critical bug in the Jira attachment tool call involving incorrect data structures and encoding. Performance improvements were also requested to wrap blocking synchronous calls in threads within asynchronous methods, and a simplification was suggested for unreachable code in the GitLab MR search logic.

Comment thread ymir/agents/utilities/baseline_tests.py
Comment thread ymir/tools/privileged/errata.py
Comment thread ymir/tools/unprivileged/analyze_ewa_testrun.py Outdated
Comment thread ymir/agents/issue_verification_agent.py

@TomasTomecek TomasTomecek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, this is massive, thank you for working on this

are you also planning to drop the former supervisor code?

btw this definitely needs rebase against upstream/main

@martinky82

martinky82 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

After the errata agent is moved out of supervisor, the supervisor will be dropped altogether of course. I reckon it's on the safe side to keep the code in there for the moment.

Yeah, some stuff landed since I started working on it so rebase it needs.

@martinky82 martinky82 force-pushed the main branch 2 times, most recently from 024e20f to 03eab1a Compare May 12, 2026 13:18
@martinky82

Copy link
Copy Markdown
Contributor Author

I rebased the PR and now I have the pre-commit installed as well, so it should be in better shape than the first attempt.

@TomasTomecek TomasTomecek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address the bug with the issue_key, the other 2 comments are mostly cosmetic

Comment thread ymir/agents/issue_verification_agent.py
return JSONToolOutput(result=results)

except Exception as e:
from beeai_framework.tools import ToolError

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, elaborate?

Comment thread ymir/agents/issue_verification_agent.py Outdated
@TomasKorbar TomasKorbar self-requested a review May 14, 2026 09:19
Comment thread agents_as_skills/issue_verification/SKILL.md Outdated
Comment thread ymir/agents/utilities/baseline_tests.py
Comment thread ymir/agents/utilities/compare_xunit.py
Comment thread ymir/agents/issue_verification_agent.py Outdated
Comment thread ymir/agents/issue_verification_agent.py Outdated
Comment thread ymir/tools/unprivileged/read_attachment.py Outdated
Comment thread ymir/tools/unprivileged/read_logfile.py Outdated
Comment thread ymir/tools/unprivileged/read_readme.py
Comment thread ymir/tools/unprivileged/search_resultsdb.py Outdated
Comment thread ymir/tools/unprivileged/search_resultsdb.py Outdated
@TomasKorbar

Copy link
Copy Markdown
Collaborator

Additional note, please implement makefile target for this so it can be triggered as the other agents. For example like we do with triage make run-triage-agent-standalone DRY_RUN=true

@TomasTomecek TomasTomecek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used opus to review this PR and overall it's very well done there is just one internal API breakage:

Broken caller of get_jira_dev_status in zstream_search.py

The return type of GetJiraDevStatusTool and GetJiraPullRequestsTool changed from a bare list to a dict wrapper ({"commits": [...]} / {"pull_requests": [...]}). preliminary_testing_agent.py was updated to handle
this, but zstream_search.py was missed.

In ymir/tools/privileged/zstream_search.py around line 235-244:

dev_status = await run_tool(GetJiraDevStatusTool(), issue_key=issue_key)
commits = json.loads(dev_status) if isinstance(dev_status, str) else dev_status
# ...
commit_urls = [_get_patch_url(c["url"]) for c in commits if c.get("url")]

After this change, commits will be {"commits": [...]} instead of a list, so iterating it will iterate over dict keys ("commits") rather than commit objects, causing a KeyError.

The test mocks in ymir/agents/tests/unit/test_zstream_search.py also still return bare lists, so the tests pass but don't catch this.


Otherwise LGTM, thank you for working on this!! Looking fwd to trying this out.

@martinky82

Copy link
Copy Markdown
Contributor Author

I used opus to review this PR and overall it's very well done there is just one internal API breakage:

Broken caller of get_jira_dev_status in zstream_search.py

Good catch, thanks! Fixed in the last commit.

@martinky82

Copy link
Copy Markdown
Contributor Author

Additional note, please implement makefile target for this so it can be triggered as the other agents. For example like we do with triage make run-triage-agent-standalone DRY_RUN=true

Makefile target is implemented, thanks for the hint.

TomasTomecek
TomasTomecek previously approved these changes May 21, 2026

@TomasTomecek TomasTomecek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though this needs a rebase

@martinky82

Copy link
Copy Markdown
Contributor Author

LGTM, though this needs a rebase

Rebased

TomasKorbar
TomasKorbar previously approved these changes May 21, 2026
Move the IssueHandler workflow from ymir/supervisor/ into a standalone
BeeAI Framework agent at ymir/agents/issue_verification_agent.py,
following the pattern established by preliminary_testing_agent.

This includes:
- New agent: issue_verification_agent with Workflow-based state machine
- Testing analyst inlined as a sub-agent for AI-driven test result
  analysis, using ReasoningAgent with maintainer rules from MCP
- New MCP tools: errata (GetErratum, GetErratumBuildNvr),
  testing_farm (GetTestingFarmRequest, ReproduceTestingFarmRequest),
  gitlab (SearchGitlabProjectMrs), jira (UpdateJiraComment,
  AddJiraAttachments, GetJiraAttachment)
- New unprivileged tools: read_logfile, read_readme, search_resultsdb,
  analyze_ewa_testrun
- Supporting modules moved to ymir/agents/utilities/
- Shared types added to ymir/common/models.py (JotnarTag renamed to
  YmirTag)
- Skill definition for issue_verification with full workflow details
- Makefile target and compose service for standalone execution
- Jira dev-status tools return dict-wrapped responses for MCP compliance
- Blocking sync calls wrapped in asyncio.to_thread
- URL allowlisting removed from read_logfile (egress control handles
  security)

The supervisor's ErratumHandler remains unchanged for a follow-up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TomasKorbar TomasKorbar merged commit 8f77cfe into packit:main May 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants